import {onBeforeUnmount, ref} from "vue";

export function  changeMouse(){
    const  x=ref();
    const y=ref();
    document.addEventListener('click',getMouse);
    function  getMouse(e){
        x.value=e.pageX;
        y.value=e.pageY;
    }
    onBeforeUnmount(()=>{
        document.addEventListener('click',getMouse);
    })
    return {x,y}
}